<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Logs {

    function __construct() {
        $this->ci = & get_instance();
        $this->ci->load->database();
        $this->ci->load->config('config', TRUE);
    }

    function gravar($_array) {
        $this->ci->db->insert('log', $_array);
    }
    
    function getLogByOperacao($_operacao){
        $this->ci->db->select('email, ip, data_add');
        //$this->ci->db->from('log');
        $this->ci->db->join('users', 'users.id = log.users_id');
        $this->ci->db->where('url', $_operacao);
        return $this->ci->db->get('log');
    }
}

